package omm.domain.comparativegraph;

import java.util.AbstractMap;
import java.util.Map.Entry;

import omm.domain.Entity;
import omm.domain.Order;
import omm.domain.Quotation;

public class EntityStrategy implements GroupStrategy {

	@Override
	public Entry<String, Double> makeEntry(Quotation quotation) {
		
		Order order = quotation.getOrder();
		if (order == null)return null;
		Entity entity = order.getEntity();
		if(entity== null) return null;
		//TODO:Ver si hay mas filtros
		Entry<String, Double> entry = new AbstractMap.SimpleEntry<String, Double>(entity.getName(), quotation.getAonCommision());
		return entry;
	}

}
